/**
 * 
 */
package cvcg.util;

import org.apache.click.Context;
import org.apache.click.control.Decorator;

import cvcg.model.GameSession;

/**
 * @author jaracje
 *
 */
public class GameSessionStatusDecorator implements Decorator {

	/* (non-Javadoc)
	 * @see org.apache.click.control.Decorator#render(java.lang.Object, org.apache.click.Context)
	 */
	@Override
	public String render(Object object, Context context) {		
		GameSession gameSession = (GameSession) object;
		String deco;
		if (GameSession.STATUS_PHASE1.equals(gameSession.getStatus())) 
		{
			deco = "<IMG alt=\"phase1\" src=\"../assets/images/_number_1_16x16.png\"/>";
		} else if (GameSession.STATUS_PHASE2.equals(gameSession.getStatus())) 
		{
			deco = "<IMG alt=\"phase2\" src=\"../assets/images/_number_2_16x16.png\"/>";
		} else {
			deco = "<IMG alt=\"phase3\" src=\"../assets/images/_number_3_16x16.png\"/>";
		}
		return deco;
	}

}
